<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<div th:replace="themes/default/header::header(${article.title},${article.tags})"></div>
<style>
    .editormd-preview-active {
        padding: 0;
    }
    .editormd-html-preview ol.linenums li, .editormd-preview-container ol.linenums li {
        list-style-type: none;
    }
</style>
<body>
<article class="main-content post-page" itemscope="" itemtype="http://schema.org/Article">
    <div class="post-header">
        <h1 class="post-title" itemprop="name headline">
            <a th:href="${commons.permalink(article)}" th:text="${article.title}" data-no-instant=""></a>
        </h1>
        <div class="post-data">
            <time th:datetime="${#dates.format(article.createTime, 'yyyy-MM-dd HH:mm:ss')}" itemprop="datePublished"
                  th:text="'发布于 '+ ${#dates.format(article.createTime, 'yyyy-MM-dd HH:mm:ss')}"></time>
            /
            <th:block th:utext="${commons.showCategories(article.categories)}"/>
            / <a href="#comments" th:text="${article.commentsNum ?: 0}+' 条评论'"></a> /
            <th:block th:text="${article.hits}"/>
            浏览
        </div>
    </div>
    <div id="post-content"
         class="markdown-body editormd-html-preview  editormd-preview-container editormd-preview-active"
         itemprop="articleBody">
        <p class="post-tags" th:utext="${commons.showTags(article.tags)}"></p>
        <th:block th:utext="${commons.article(article.content)}"/>
    </div>
    <p class="post-info">
        最后编辑时间为:
        <th:block th:text="${#dates.format(article.updateTime, 'yyyy-MM-dd HH:mm:ss')}"/>
    </p>
</article>
<div th:replace="themes/default/comments::comments"></div>
<div th:replace="themes/default/footer::footer"></div>


</body>
<script type="text/javascript">
    $(function () {
        editormd.markdownToHTML("post-content", {
            htmlDecode: "style,script,iframe",  // you can filter tags decode
            emoji: true,
            taskList: true,
            tex: true,  // 默认不解析
            path: "/static/admin/plugins/editormd/lib/",
            pluginPath: "/static/admin/plugins/editormd/plugins/",
            flowChart: true,  // 默认不解析
            sequenceDiagram: true,  // 默认不解析
        });
    })
</script>
</html>